{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Tce3stUlHN0L"
      },
      "source": [
        "##### Copyright 2025 Google LLC."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "cellView": "form",
        "id": "tuOe1ymfHZPu"
      },
      "outputs": [],
      "source": [
        "# @title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
        "# you may not use this file except in compliance with the License.\n",
        "# You may obtain a copy of the License at\n",
        "#\n",
        "# https://www.apache.org/licenses/LICENSE-2.0\n",
        "#\n",
        "# Unless required by applicable law or agreed to in writing, software\n",
        "# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
        "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
        "# See the License for the specific language governing permissions and\n",
        "# limitations under the License."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "b19f6be7"
      },
      "source": [
        "# Personalized Product Descriptions with Weaviate and the Gemini API"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MfBg1C5NB3X0"
      },
      "source": [
        "<a target=\"_blank\" href=\"https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/weaviate/personalized_description_with_weaviate_and_gemini_api.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" height=30/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "bbf4f2c17530"
      },
      "source": [
        "<!-- Princing warning Badge -->\n",
        "<table>\n",
        "  <tr>\n",
        "    <!-- Emoji -->\n",
        "    <td bgcolor=\"#f5949e\">\n",
        "      <font size=30>⚠️</font>\n",
        "    </td>\n",
        "    <!-- Text Content Cell -->\n",
        "    <td bgcolor=\"#f5949e\">\n",
        "      <h3><font color=black>This notebook requires paid tier rate limits to run properly.<br>  \n",
        "(cf. <a href=\"https://ai.google.dev/pricing#veo2\"><font color='#217bfe'>pricing</font></a> for more details).</font></h3>\n",
        "    </td>\n",
        "  </tr>\n",
        "</table>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "2ead11e5e73b"
      },
      "source": [
        "Weaviate is an open-source vector database that enables you to build AI-powered applications with the Gemini API! This notebook has four parts:\n",
        "1. [Part 1: Connect to Weaviate, Define Schema, and Import Data](#part-1-install-dependencies-and-connect-to-weaviate)\n",
        "\n",
        "2. [Part 2: Run Vector Search Queries](#part-2-vector-search)\n",
        "\n",
        "3. [Part 3: Generative Feedback Loops](#part-3-generative-feedback-loops)\n",
        "\n",
        "4. [Part 4: Personalized Product Descriptions](#part-4-personalization)\n",
        "\n",
        "\n",
        "In this demo, you will learn how to embed your data, run a semantic search, make a generative call to the Gemini API and store the output in your vector database, and personalize the description based on the user profile.\n",
        "\n",
        "## Use Case\n",
        "\n",
        "You will be working with an e-commerce dataset containing Google merch. You will load the data into the Weaviate vector database and use the semantic search features to retrieve data. Next, you'll generate product descriptions and store them back into the database with a vector embedding for retrieval (aka, generative feedback loops). Lastly, you'll create a small knowledge graph with uniquely generated product descriptions for the buyer personas Alice and Bob.\n",
        "\n",
        "## Requirements\n",
        "You will need a running Weaviate cluster and Gemini API key. You'll set up these requirements as you progress through this notebook!\n",
        "\n",
        "1. Weaviate vector database\n",
        "    1. Serverless\n",
        "    1. Embedded\n",
        "    1. Local (Docker)\n",
        "1. Gemini API key\n",
        "    1. Create an API key via [AI Studio](https://aistudio.google.com/)\n",
        "\n",
        "## Video\n",
        "**For an awesome walk through of this demo, check out [this](https://youtu.be/WORgeRAAN-4?si=-WvqNkPn8oCmnLGQ&t=1138) presentation from Google Cloud Next!**\n",
        "\n",
        "[![From RAG to autonomous apps with Weaviate and Gemini API on Google Kubernetes Engine](http://i3.ytimg.com/vi/WORgeRAAN-4/hqdefault.jpg)](https://youtu.be/WORgeRAAN-4?si=-WvqNkPn8oCmnLGQ&t=1138)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7Wlb0vCDUK3h"
      },
      "source": [
        "## Install Dependencies and Libraries"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "1eQSHZzRx3n6"
      },
      "outputs": [],
      "source": [
        "%pip install weaviate-client==4.7.1\n",
        "%pip install -U -q \"google-genai>=1.0.0\"\n",
        "%pip install requests\n",
        "%pip install 'protobuf>=5'"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "id": "iKmPS8v7s_Xc"
      },
      "outputs": [],
      "source": [
        "import weaviate\n",
        "from weaviate.classes.config import Configure\n",
        "from weaviate.embedded import EmbeddedOptions\n",
        "import weaviate.classes as wvc\n",
        "from weaviate.classes.config import Property, DataType, ReferenceProperty\n",
        "from weaviate.util import generate_uuid5\n",
        "from weaviate.classes.query import QueryReference\n",
        "\n",
        "import os\n",
        "import json\n",
        "import requests\n",
        "import PIL\n",
        "import IPython\n",
        "\n",
        "from PIL import Image\n",
        "from io import BytesIO\n",
        "from IPython.display import Markdown\n",
        "\n",
        "# Convert image links to PIL object\n",
        "def url_to_pil(url):\n",
        "    response = requests.get(url)\n",
        "    return Image.open(BytesIO(response.content))\n",
        "\n",
        "# display images\n",
        "def display_image(url, size=100):\n",
        "    response = requests.get(url)\n",
        "    image_data = BytesIO(response.content)\n",
        "    image = Image.open(image_data)\n",
        "\n",
        "    resized_image = image.resize((size,size))\n",
        "\n",
        "    display(resized_image)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "cee8989d"
      },
      "source": [
        "## Part 1: Connect to Weaviate, Define Schema, and Import Data"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "t1Uc93joUOAR"
      },
      "source": [
        "### Connect to Weaviate\n",
        "\n",
        "You will need to create a Weaviate cluster. There are a few ways to do this:\n",
        "\n",
        "1. [Weaviate Embedded](https://weaviate.io/developers/weaviate/installation/embedded): Run Weaviate in your runtime\n",
        "\n",
        "2. [Weaviate Cloud](console.weaviate.cloud): Create a sandbox on our managed service. You will need to deploy it in US West, US East, or Australia.\n",
        "\n",
        "3. Local Host: [Docker](https://weaviate.io/developers/weaviate/installation/docker-compose#starter-docker-compose-file) or [Kubernetes](https://weaviate.io/developers/weaviate/installation/kubernetes)\n",
        "\n",
        "For the full list of installation options, see [this page](https://weaviate.io/developers/weaviate/installation)."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "897684f3"
      },
      "source": [
        "#### Weaviate Embedded\n",
        "You will default to Weaviate Embedded. This runs Weaviate inside your notebook and is ideal for quick experimentation.\n",
        "\n",
        "**Note: It will disconnect once you stop the terminal.**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "033eec7e"
      },
      "source": [
        "**Set up your API key**\n",
        "\n",
        "To run the following cell, your Gemini API key must be stored in a Colab Secret and named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see the [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) quickstart for an example."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "id": "b2a9dc37"
      },
      "outputs": [],
      "source": [
        "from google import genai\n",
        "from google.colab import userdata\n",
        "\n",
        "GEMINI_API_KEY = userdata.get(\"GEMINI_API_KEY\")\n",
        "gemini_client = genai.Client(api_key=GEMINI_API_KEY)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "id": "QveBlU9aL7jI"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "INFO:weaviate-client:Binary /root/.cache/weaviate-embedded did not exist. Downloading binary from https://github.com/weaviate/weaviate/releases/download/v1.25.10/weaviate-v1.25.10-Linux-amd64.tar.gz\n",
            "INFO:weaviate-client:Started /root/.cache/weaviate-embedded: process ID 716\n"
          ]
        }
      ],
      "source": [
        "client = weaviate.WeaviateClient(\n",
        "    embedded_options=EmbeddedOptions(\n",
        "        version=\"1.25.10\",\n",
        "        additional_env_vars={\n",
        "            \"ENABLE_MODULES\": \"text2vec-palm, generative-palm\"\n",
        "        }),\n",
        "        additional_headers={\n",
        "            \"X-Google-Studio-Api-Key\": GEMINI_API_KEY\n",
        "        }\n",
        ")\n",
        "\n",
        "client.connect()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "1a554d15"
      },
      "source": [
        "#### Other Options: Weaviate Cloud and Local Host"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "39aa28eb"
      },
      "source": [
        "#### **Weaviate Cloud**\n",
        "\n",
        "You can connect your notebook to a serverless Weaviate cluster to keep the data persistent in the cloud. You can register [here](https://console.weaviate.cloud/) and create a free 14-day sandbox!\n",
        "\n",
        "To connect to your WCD cluster:\n",
        "```python\n",
        "WCD_URL = \"https://sandbox.gcp.weaviate.cloud\"\n",
        "WCD_AUTH_KEY = \"sk-key\"\n",
        "GEMINI_API_KEY = \"sk-key\"\n",
        "\n",
        "client = weaviate.connect_to_wcs(\n",
        "    cluster_url=WCD_URL,\n",
        "    auth_credentials=weaviate.auth.AuthApiKey(WCD_AUTH_KEY),\n",
        "    headers={\"X-Google-Studio-Api-Key\": GEMINI_API_KEY},\n",
        ")\n",
        "\n",
        "print(client.is_ready())\n",
        "```"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "e400af40"
      },
      "source": [
        "#### **Local Host**\n",
        "\n",
        "If you want to run Weaviate yourself, you can download the [Docker files](https://weaviate.io/developers/weaviate/installation/docker-compose) and run it locally on your machine or in the cloud. There is also a `yaml` file in this folder you can use.\n",
        "\n",
        "To connect to Weaviate locally:\n",
        "```python\n",
        "client = weaviate.connect_to_local()\n",
        "\n",
        "print(client.is_ready())\n",
        "```"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "mBahZ-eCrjJD"
      },
      "source": [
        "### Create schema\n",
        "The schema tells Weaviate how you want to store your data.\n",
        "\n",
        "You will first create two collections: Products and Personas. Each collection has metadata (properties) and specifies the embedding and language model.\n",
        "\n",
        "In [Part 4](#part-4-personalization), you will create another collection, `Personalized`, that will generate product descriptions based on the persona."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "id": "842e00de"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "None\n",
            "None\n"
          ]
        }
      ],
      "source": [
        "# This is optional to empty your database\n",
        "result = client.collections.delete(\"Products\")\n",
        "print(result)\n",
        "result = client.collections.delete(\"Personas\")\n",
        "print(result)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "id": "LUmbb63eOGvX"
      },
      "outputs": [],
      "source": [
        "PROJECT_ID = \"\" # leave this empty\n",
        "API_ENDPOINT = \"generativelanguage.googleapis.com\"\n",
        "embedding_model = \"text-embedding-004\" # embedding model\n",
        "generative_model = \"gemini-1.5-flash-latest\" # language model\n",
        "\n",
        "# Products Collection\n",
        "if not client.collections.exists(\"Products\"):\n",
        "  collection = client.collections.create(\n",
        "    name=\"Products\",\n",
        "    vectorizer_config=Configure.Vectorizer.text2vec_palm\n",
        "    (\n",
        "        project_id=PROJECT_ID,\n",
        "        api_endpoint=API_ENDPOINT,\n",
        "        model_id = embedding_model\n",
        "    ),\n",
        "    generative_config=Configure.Generative.palm(\n",
        "        project_id=PROJECT_ID,\n",
        "        api_endpoint=API_ENDPOINT,\n",
        "        model_id = generative_model\n",
        "    ),\n",
        "    properties=[ # properties for the Products collection\n",
        "            Property(name=\"product_id\", data_type=DataType.TEXT),\n",
        "            Property(name=\"title\", data_type=DataType.TEXT),\n",
        "            Property(name=\"category\", data_type=DataType.TEXT),\n",
        "            Property(name=\"link\", data_type=DataType.TEXT),\n",
        "            Property(name=\"description\", data_type=DataType.TEXT),\n",
        "            Property(name=\"brand\", data_type=DataType.TEXT),\n",
        "            Property(name=\"generated_description\", data_type=DataType.TEXT),\n",
        "      ]\n",
        "  )\n",
        "\n",
        "# Personas Collection\n",
        "if not client.collections.exists(\"Personas\"):\n",
        "  collection = client.collections.create(\n",
        "    name=\"Personas\",\n",
        "    vectorizer_config=Configure.Vectorizer.text2vec_palm\n",
        "    (\n",
        "        project_id=PROJECT_ID,\n",
        "        api_endpoint=API_ENDPOINT,\n",
        "        model_id = embedding_model\n",
        "    ),\n",
        "    generative_config=Configure.Generative.palm(\n",
        "        project_id=PROJECT_ID,\n",
        "        api_endpoint=API_ENDPOINT,\n",
        "        model_id = generative_model\n",
        "    ),\n",
        "    properties=[ # properties for the Personas collection\n",
        "            Property(name=\"name\", data_type=DataType.TEXT),\n",
        "            Property(name=\"description\", data_type=DataType.TEXT),\n",
        "      ]\n",
        "  )"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "v5sYXBkMAZZm"
      },
      "source": [
        "### Import Objects"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "id": "vo0WckWt_gyq"
      },
      "outputs": [],
      "source": [
        "# URL to the raw JSON file\n",
        "url = 'https://raw.githubusercontent.com/bkauf/next-store/main/first_99_objects.json'\n",
        "response = requests.get(url)\n",
        "\n",
        "# Load the entire JSON content\n",
        "data = json.loads(response.text)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "id": "-uxOVFZ6_iA7"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "{'id': 'id_1',\n",
              " 'product_id': 'GGOEGAYC135814',\n",
              " 'title': 'Google Badge Tee',\n",
              " 'category': 'Apparel  Accessories Tops  Tees Tshirts',\n",
              " 'link': 'https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGXXX1358.jpg',\n",
              " 'description': 'A classic crew neck tee made from 100 cotton Its soft and comfortable and features a small Google logo on the chest',\n",
              " 'color': \"['Blue']\",\n",
              " 'gender': 'Unisex',\n",
              " 'brand': 'Google'}"
            ]
          },
          "execution_count": 9,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# Print first object\n",
        "data[0]"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "3QhqNKBsvTND"
      },
      "source": [
        "#### Upload to Weaviate\n",
        "\n",
        "To make sure everything is set, you will upload only one object and confirm it's in the database."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "id": "2762abcc"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "1\n"
          ]
        }
      ],
      "source": [
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "first_object = data[0]\n",
        "\n",
        "products.data.insert(\n",
        "    properties={\n",
        "        \"product_id\": first_object['product_id'],\n",
        "        \"title\": first_object['title'],\n",
        "        \"category\": first_object['category'],\n",
        "        \"link\": first_object['link'],\n",
        "        \"description\": first_object['description'],\n",
        "        \"brand\": first_object['brand']\n",
        "    }\n",
        ")\n",
        "\n",
        "response = products.aggregate.over_all(total_count=True)\n",
        "print(response.total_count) # This should output 1"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "f7eec0d7"
      },
      "source": [
        "Let's import the remainder of our dataset. You will use Weaviate's batch import to get the 98 objects into our database."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "id": "UUZ1yJAvuQXT"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "99\n"
          ]
        }
      ],
      "source": [
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "remaining_data = data[1:]\n",
        "\n",
        "with products.batch.dynamic() as batch:\n",
        "  for item in remaining_data:\n",
        "    batch.add_object(\n",
        "      properties={\n",
        "        \"product_id\": item['product_id'],\n",
        "        \"title\": item['title'],\n",
        "        \"category\": item['category'],\n",
        "        \"link\": item['link'],\n",
        "        \"description\": item['description'],\n",
        "        \"brand\": item['brand']\n",
        "    }\n",
        "  )\n",
        "\n",
        "response = products.aggregate.over_all(total_count=True)\n",
        "print(response.total_count) # this should print 99"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "id": "P5gC08735iVZ"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "000db09a-3e33-462d-be03-5715d9cde529 \n",
            " {\n",
            "    \"description\": \"The unisex Waze logo hoodie is a perfect way to show your love for the Waze app The hoodie is made of a soft and comfortable cotton blend and features a kangaroo pocket and a drawstring hood The Waze logo is embroidered on the front of the hoodie\",\n",
            "    \"generated_description\": null,\n",
            "    \"product_id\": \"GGCPWAEJ402614\",\n",
            "    \"link\": \"https://shop.googlemerchandisestore.com/store/20190522377/assets/items/images/GGCPWXXX4026.jpg\",\n",
            "    \"category\": \"Clothing Unisex Clothing Hoodies  Sweatshirts\",\n",
            "    \"title\": \"Unisex Waze Logo Hoodie\",\n",
            "    \"brand\": \"Waze\"\n",
            "}\n"
          ]
        }
      ],
      "source": [
        "# print the first object uuid and properties to analyze how data is structured\n",
        "first_product = next(products.iterator())\n",
        "print(first_product.uuid,\"\\n\", json.dumps(first_product.properties, indent=4))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "a8c64f21"
      },
      "source": [
        "You will fetch the object by the UUID that was created. It will print out the vector embedding as well!"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "id": "i-OEzKw85-LY"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Product: Unisex Waze Logo Hoodie\n",
            "Vector Dimensionality: 768\n",
            "Vector Preview: [0.000302837259368971, -0.009837448596954346, 0.022877082228660583, -0.012845730409026146, 0.03479452058672905, 0.06852656602859497, 0.023823168128728867, -0.008967291563749313, -0.007616781629621983, 0.03446043282747269, -0.03289780020713806, -0.041297584772109985, 0.047338180243968964, -0.007135987281799316, 0.03441719338297844, -0.09767945110797882, -0.02126118168234825, 0.041591379791498184, -0.04611879959702492, -0.040249183773994446, -0.032080017030239105, -0.04292743653059006, 0.03954688459634781, -0.04586683586239815, -0.008462391793727875, 0.010463248938322067, 0.021219832822680473, 0.04991120845079422, 0.00274534709751606, -0.02430199831724167, 0.07378753274679184, 0.015373442322015762, -0.03711485117673874, -0.021959325298666954, 0.030712256208062172, -0.029576774686574936, -0.023318929597735405, 0.003632798558101058, -0.012349340133368969, -0.054480548948049545, -0.037265971302986145, 0.04853177070617676, -0.04757307469844818, -0.00198557460680604, 0.027546513825654984, 0.03101896308362484, -0.02321699447929859, 0.01798059605062008, 0.011385709047317505, 0.07581991702318192] ...\n"
          ]
        }
      ],
      "source": [
        "product = products.query.fetch_object_by_id(\n",
        "    first_product.uuid,\n",
        "    include_vector=True\n",
        ")\n",
        "\n",
        "print(f\"Product: {product.properties['title']}\")\n",
        "print(f\"Vector Dimensionality: {len(product.vector['default'])}\")\n",
        "print(f\"Vector Preview: {product.vector['default'][:50]} ...\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "1c6202c0"
      },
      "source": [
        "## Part 2: Vector Search"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "RVKqhfrcyHOb"
      },
      "source": [
        "### Vector Search\n",
        "Vector search returns the objects with most similar vectors to that of the query. You will use the `near_text` operator to find objects with the nearest vector to an input text."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "metadata": {
        "id": "F70gYJJzxYHt"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "{\n",
            "  \"title\": \"Google Campus Bike Mug\",\n",
            "  \"description\": \"The Google Campus Bike Corkbase Mug is a blue mug with a cork bottom It features a design of a yellow bicycle with a basket on the front The mug is perfect for coffee tea or any other hot beverage\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGDWC122799.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy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              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{\n",
            "  \"title\": \"Google San Francisco Mug\",\n",
            "  \"description\": \"The Google San Francisco Mug is a black and white mug with the Google logo on it It is made of ceramic and is dishwasher safe\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGDWJ146799.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHy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k=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{\n",
            "  \"description\": \"The YETI Rambler 20 oz Tumbler is made of stainless steel and has a doublewall vacuum insulation to keep drinks cold for up to 24 hours and hot for up to 12 hours It is also dishwashersafe for easy cleaning The tumbler is silver and has the Google Cloud Certified logo on it\",\n",
            "  \"title\": \"Google Cloud Certified Professional Security Engineer Tumbler\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20230615372/assets/items/images/GGCLCDNJ121099.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkN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CE/urqUDtuUH+WK36KAMNvDpcYa849ov/r0+y8M2Vpdx3RaSWaM5QsQAD64FbNFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//2Q==",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n"
          ]
        }
      ],
      "source": [
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "response = products.query.near_text(\n",
        "        query=\"travel mug\",\n",
        "        return_properties=[\"title\", \"description\", \"link\"], # only return these 3 properties\n",
        "        limit=3 # limited to 3 objects\n",
        ")\n",
        "\n",
        "for product in response.objects:\n",
        "    print(json.dumps(product.properties, indent=2))\n",
        "    display_image(product.properties['link'])\n",
        "    print('===')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Wm5SR_0nrlju"
      },
      "source": [
        "### Hybrid Search\n",
        "[Hybrid search](https://weaviate.io/developers/weaviate/search/hybrid) combines keyword (BM25) and vector search together, giving you the best of both algorithms.\n",
        "\n",
        "To use hybrid search in Weaviate, all you have to do is define the `alpha` parameter to determine the weighting.\n",
        "\n",
        "`alpha` = 0 --> pure BM25\n",
        "\n",
        "`alpha` = 0.5 --> half BM25, half vector search\n",
        "\n",
        "`alpha` = 1 --> pure vector search"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "metadata": {
        "id": "egqvUe2-rpnh"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "{\n",
            "  \"title\": \"Create Design Code Build Cork Bottom Tumbler\",\n",
            "  \"description\": \"This black tumbler is made of stainless steel and has a cork bottom It is perfect for keeping your drinks hot or cold for hours The tumbler is also dishwasher safe for easy cleaning\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGDNB198099.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/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A4OOT29eaimmhL7JGXzEMbHPVT1H401F+amB798IoYo/D+omAkwm9YIT1KgDFehVwnwki8vwSG/v3Ln9AK7ukAUUUUAFFFFABRRRQAUUUUAeGfEzw9NP4oup4GXdJh9rcZyB3rgDoepR/8ucje64P8q+hvGGgT6l5d1aIGlRdrL/eHb8a89ntbm1YrPayRHuGQiuKrWq05PS6PQo0KNWKd7M86/sfUicfYZx9Vq5a+HL95B5qLEpPVmyfyFdqAzdFJOcYAzWtpXh3UdRmULbPHETzJIu0Ae3rULFVZ6RRpLCUYK8mdx4DsP7O8H2cOScln5GOp/wDrV0lQ2tulpaQ28YwkaBR+FTV3xTSVzzZNNtoKKKKZIUUUUAFFFFABRRRQAUhVW6qD9RRRQA0RRqciNR9BT+lFFABRRRQAUUUUAFFFFAH/2Q==",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{\n",
            "  \"description\": \"The Google San Francisco Mug is a black and white mug with the Google logo on it It is made of ceramic and is dishwasher safe\",\n",
            "  \"title\": \"Google San Francisco Mug\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGDWJ146799.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE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ZB78DpTJtYkkhNvawLbQHqI+rfU96AH6zeJLKlrCd0MAI3f3mPU1VtPv5x0qm2QxBq1a/NMFQEnpjuaBm7YeF9X1HV4Y9LgEiS/OWkUGOPsd2Rx/9eu5h+EVxPg6jrS4znbBETj2G44x+FdX4DsZ7LQF8+Jo3kO7DDBx2rqKQjA8P+DtH8N/PZwM9yRg3Ex3Pj0HYD6Vv0UUAFFFFABUU9tBdRGOeJJUPVXUEGpaKAOUvvhx4Xv2LPpiRse8LFP5GsWb4OeH3/1VxexfSQH+Yr0WigDzA/BXTM/Lql4PqFP9Kkj+DmnL97VLwj2Cj+lel0UAcFbfCPw3CwMourg/7cpA/TFdLpnhbRNIwbLToImH8e3Lfmea2KKADpRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//9k=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{\n",
            "  \"description\": \"The Sip by Swell 17oz Stainless Steel Water Bottle is made of doublewalled vacuuminsulated stainless steel and features a leakproof design It keeps drinks cold for up to 24 hours and hot for up to 12 hours The bottle has a wide mouth opening for easy filling and cleaning and a builtin carrying loop for easy transport The Google Cloud logo is printed on the front of the bottle\",\n",
            "  \"title\": \"Google Cloud Sip by Swell 17oz Stainless Steel Water Bottle\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20210125633/assets/items/images/GGEBCCBA112199.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjI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9pDqV6lvJdvsgUqTvOQOw45YdfWtbc1ZeqeH9J1qe0m1KxjuZLR98DPn5DkHseeQOvpWlTAkU5GaWmp92nUgCiiigAooooAim6r9aqarK8WlymNSWIwCFDbTnjg9fTv1q3N1X61Desi6fM0i7kC8jHX/Pr2pSaSbY0pN2juRaXdG705Gd90qkrINu3a2emKtw9WqtYeUbCNoYwit2AHbjt16de9WYP4vrRFppNfiK0k7T38iWoj94/WpaqzzLCryOcKvJNMBzSojqjOqs/CqSAW+nrT6wb37DqF2jC/jVtmABGGcYOcqf4TWvFd287FYpVdsZIHahXtdhdXsi0n3adTU+4KdQAUUUUAFFFFAEM/8AD9aq30EtxCqx/MvIePeU3qQR1wemat3AzETgkjkYGahWdcAHIPuMU4vldyZRUlZiWsT29nHFIwLKD0JIHPAGew6fhU0H8f1qJ51BwMk+wzU1v/qs7WBPJDDFDd3caVlZEtVXP7xvrVqqkgIlbg9fSkMMDOcDPTOKWkwfQ/lRz6H8qALMf+rFOpsYxGKdQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n"
          ]
        }
      ],
      "source": [
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "response = products.query.hybrid(\n",
        "    query = \"dishwasher safe container\", # query\n",
        "    alpha = 0.75, # leaning more towards vector search\n",
        "    return_properties=[\"title\", \"description\", \"link\"], # return these 3 properties\n",
        "    limit = 3 # limited to only 3 objects\n",
        ")\n",
        "\n",
        "for product in response.objects:\n",
        "    print(json.dumps(product.properties, indent=2))\n",
        "    display_image(product.properties['link'])\n",
        "    print('===')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "M7bX-bV5rqnR"
      },
      "source": [
        "### Autocut\n",
        "Rather than hard-coding the limit on the number of objects (seen above), the [autocut](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut) feature can be used to cut off the result set. Autocut limits the number of results returned based on significant variations in the result set's metrics, such as vector distance or score.\n",
        "\n",
        "\n",
        "To use autocut, you must specify the `auto_limit` parameter, which will stop returning results after the specified number of variations, or \"jumps\" is reached.\n",
        "\n",
        "You will use the same hybrid search query above but use `auto_limit` rather than `limit`. Notice how there are actually 4 objects retrieved in this case, compared to the 3 objects returned in the previous query."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "metadata": {
        "id": "JaEOs-mVruBf"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "{\n",
            "  \"description\": \"This black tumbler is made of stainless steel and has a cork bottom It is perfect for keeping your drinks hot or cold for hours The tumbler is also dishwasher safe for easy cleaning\",\n",
            "  \"title\": \"Create Design Code Build Cork Bottom Tumbler\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGDNB198099.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4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RU06/PLl5WiVhZQlzubfkd18D4s+JLqTH3bRv1Za94rxX4HRf8AEx1OT+7Aq/m3/wBavaq6DUKKKKACiiigAooooAKjuF320y/3kYfpUlGM8etAHyTKHXWiqKGYsy4JxkEEHntxmrUM6W0RtP7NZwjZCyOGBxg5LY68EDtzTpbVpfFy2qypCz3flCRxkLlsZI71auLXWLa0nn8q0eCNSzTeYo2rxgEbuGIdTjk/MKtU6M1797i9viKT/dWt59ypNfbrS6R9NcmNBEZpAvXkdhjq2eKxlHAq1Jq091bvDJHGN+Mlc9Ac4xnHWqy9al06cHansV7etWV626PZvghFiPV5P+ua/wDoVeu15d8E48aPqcn96ZB+QP8AjXqNIQUUUUAFFFFABRRRQAUo6ikooA+XNetf+K2ubczi2BvmXzj/AMs/n+9+FaLeHdRvI/sK6+stqrGBUkJByo3ldvqAqn64Haq3xBg8nxnqq463DH8zmuWjyhBUlSOQQcYoA6FfB8i3X2Y6la+cInnZQGwI0cqzZI5wFZsdcD1q0PC2n2rRm/1gRh9uAEA65JPJ5XA4OOT29eaimmhL7JGXzEMbHPVT1H401F+amB798IoYo/D+omAkwm9YIT1KgDFehVwnwki8vwSG/v3Ln9AK7ukAUUUUAFFFFABRRRQAUUUUAeGfEzw9NP4oup4GXdJh9rcZyB3rgDoepR/8ucje64P8q+hvGGgT6l5d1aIGlRdrL/eHb8a89ntbm1YrPayRHuGQiuKrWq05PS6PQo0KNWKd7M86/sfUicfYZx9Vq5a+HL95B5qLEpPVmyfyFdqAzdFJOcYAzWtpXh3UdRmULbPHETzJIu0Ae3rULFVZ6RRpLCUYK8mdx4DsP7O8H2cOScln5GOp/wDrV0lQ2tulpaQ28YwkaBR+FTV3xTSVzzZNNtoKKKKZIUUUUAFFFFABRRRQAUhVW6qD9RRRQA0RRqciNR9BT+lFFABRRRQAUUUUAFFFFAH/2Q==",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n"
          ]
        }
      ],
      "source": [
        "# auto_limit set to 1\n",
        "\n",
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "response = products.query.hybrid(\n",
        "    query = \"dishwasher safe container\", # query\n",
        "    alpha = 0.75, # leaning more towards vector search\n",
        "    return_properties=[\"title\", \"description\", \"link\"], # return these 3 properties\n",
        "    auto_limit = 1 # autocut after 1 jump\n",
        ")\n",
        "\n",
        "for product in response.objects:\n",
        "    print(json.dumps(product.properties, indent=2))\n",
        "    display_image(product.properties['link'])\n",
        "    print('===')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "WJG6LXJ3yKYl"
      },
      "source": [
        "### Filters\n",
        "Narrow down the results by adding a filter to the query.\n",
        "\n",
        "Find objects where `category` is equal to `drinkware`."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "metadata": {
        "id": "JnuEwgEG0PVM"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "{\n",
            "  \"category\": \"Drinkware Tumblers\",\n",
            "  \"description\": \"The SPEAR Vacuum Insulated Tumbler is made of stainless steel and has a capacity of 16 ounces It is white and has a blue and purple SPEAR logo on it\",\n",
            "  \"title\": \"SPEAR Vacuum Insulated Tumbler\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20190522377/assets/items/images/GGCPGDNQ201799.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAA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IpRrjy3H2WOxdrtWZXjEq4XbjJ3d/vCtPZSJlJR3NQ0gqjLqaRahDZtE+5wu58jCFs4B/I1FDqxknVWtikTzNCsnmA/Mueo7Dij2U7XsZuvTTs2aZ6VqWwxbRf7orDivLe4DCGVXI7d/r9K3ohiFB6KKhprRmkJxmrxd0PooopFBRRRQAUUUUAFU7wMWwrbWKEBsZwfWrlVbv76fQ0Ac4/h7znea5ktppndCW+yqo2g/MO5yfXNMvfDtv9oimsre2TaGDxuGCtnHPBzkYrfqNq0VWa6kygpbmFLoayi4kkEJndk8okEqiqAMY/A/nRBoMERQlIWxK7MGTOVPQexFbJptP29S1rmEsLRk7uP9blaGxgtQSgYtjaGdskD0HoK6NRhQPasQ84HqQK3Kzbbd2bQhGC5YqyCiiikWFFFFABRRRQAVWu+sZ9zVmq9391D/tf0oArVG1PpjUCIjSUpptACpzLGPVx/OtusaEZuYh/tCtmgYUUUUAFFFFABRRRQAVDdLmLPoc1NSMoZSp7igDOpjU+SN4/vKcetQlvegQ002hj70KrOcKpJ9hQBNZoXukPZeTWtVWzt2hUs/3m7elWqBhRRRQAUUUUAFFFFABRRRQAU0xo3VFP1FFFACCKMdI1/Kn9KKKACiiigAooooAKKKKAP//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{\n",
            "  \"category\": \"Drinkware Bottles\",\n",
            "  \"title\": \"Google Cloud Sip by Swell 17oz Stainless Steel Water Bottle\",\n",
            "  \"description\": \"The Sip by Swell 17oz Stainless Steel Water Bottle is made of doublewalled vacuuminsulated stainless steel and features a leakproof design It keeps drinks cold for up to 24 hours and hot for up to 12 hours The bottle has a wide mouth opening for easy filling and cleaning and a builtin carrying loop for easy transport The Google Cloud logo is printed on the front of the bottle\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20210125633/assets/items/images/GGEBCCBA112199.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3OiiigArn7zxHKt7dWmn2a3ElrE0krSS7FwByBwc10FcXb2l6mr6xKLKZkuIpIUPyjk8Z5I4pMaNqHXmTU49Pv7YQSzKGieOTerZGfQEVtVxt7Bdz+JtNuDZTpDHsQsQDg4x2J4rsqEDCiiimIKKKKACiiigAooooAKKKKACokGZXPvUjHCk02FeKAGOuJkPvU1NmHFKpyoPrQAtFFFABRRRQAUUUUAFFFFABRRRQAyU/J9TUkQ+Wopf4R71LH92gBJR8tMi+5j0NSSdKii/iHvQBJRRRQAUUUUAFFFFABRRRQAUUUUARy9VqG9BNi5DlGXDAhyv5kHpUsvVagvsvAkAdU81tu9xkDAz6+1ADrF2fToWcsWIPLHPc9+/1qWHq1Q2PGnxYOeDyBgHk8j29Kmh6tQBLTCxycU+oj1P1oAy9W8S6VoU9pDqV6lvJdvsgUqTvOQOw45YdfWtbc1ZeqeH9J1qe0m1KxjuZLR98DPn5DkHseeQOvpWlTAkU5GaWmp92nUgCiiigAooooAim6r9aqarK8WlymNSWIwCFDbTnjg9fTv1q3N1X61Desi6fM0i7kC8jHX/Pr2pSaSbY0pN2juRaXdG705Gd90qkrINu3a2emKtw9WqtYeUbCNoYwit2AHbjt16de9WYP4vrRFppNfiK0k7T38iWoj94/WpaqzzLCryOcKvJNMBzSojqjOqs/CqSAW+nrT6wb37DqF2jC/jVtmABGGcYOcqf4TWvFd287FYpVdsZIHahXtdhdXsi0n3adTU+4KdQAUUUUAFFFFAEM/8AD9aq30EtxCqx/MvIePeU3qQR1wemat3AzETgkjkYGahWdcAHIPuMU4vldyZRUlZiWsT29nHFIwLKD0JIHPAGew6fhU0H8f1qJ51BwMk+wzU1v/qs7WBPJDDFDd3caVlZEtVXP7xvrVqqkgIlbg9fSkMMDOcDPTOKWkwfQ/lRz6H8qALMf+rFOpsYxGKdQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{\n",
            "  \"category\": \"Drinkware\",\n",
            "  \"description\": \"This black tumbler is made of stainless steel and has a cork bottom It is perfect for keeping your drinks hot or cold for hours The tumbler is also dishwasher safe for easy cleaning\",\n",
            "  \"title\": \"Create Design Code Build Cork Bottom Tumbler\",\n",
            "  \"link\": \"https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGDNB198099.jpg\"\n",
            "}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3OiiigAqOeeK1haaeVIol+87sAB+JqSuV+IxI8D3xH+x/6EKALc3jLQInK/23pY/3rof0BqNfGWklS39o2TpgndE7MM+nSvmKY/v66bSrpksyAe1MD2Sy+ItlOZhcy2E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Aqn64Haq3xBg8nxnqq463DH8zmuWjyhBUlSOQQcYoA6FfB8i3X2Y6la+cInnZQGwI0cqzZI5wFZsdcD1q0PC2n2rRm/1gRh9uAEA65JPJ5XA4OOT29eaimmhL7JGXzEMbHPVT1H401F+amB798IoYo/D+omAkwm9YIT1KgDFehVwnwki8vwSG/v3Ln9AK7ukAUUUUAFFFFABRRRQAUUUUAeGfEzw9NP4oup4GXdJh9rcZyB3rgDoepR/8ucje64P8q+hvGGgT6l5d1aIGlRdrL/eHb8a89ntbm1YrPayRHuGQiuKrWq05PS6PQo0KNWKd7M86/sfUicfYZx9Vq5a+HL95B5qLEpPVmyfyFdqAzdFJOcYAzWtpXh3UdRmULbPHETzJIu0Ae3rULFVZ6RRpLCUYK8mdx4DsP7O8H2cOScln5GOp/wDrV0lQ2tulpaQ28YwkaBR+FTV3xTSVzzZNNtoKKKKZIUUUUAFFFFABRRRQAUhVW6qD9RRRQA0RRqciNR9BT+lFFABRRRQAUUUUAFFFFAH/2Q==",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n"
          ]
        }
      ],
      "source": [
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "response = products.query.near_text(\n",
        "    query=\"travel cup\",\n",
        "    return_properties=[\"title\", \"description\", \"category\", \"link\"], # returned properties\n",
        "    filters=wvc.query.Filter.by_property(\"category\").equal(\"Drinkware\"), # filter\n",
        "    limit=3, # limit to 3 objects\n",
        ")\n",
        "\n",
        "for product in response.objects:\n",
        "    print(json.dumps(product.properties, indent=2))\n",
        "    display_image(product.properties['link'])\n",
        "    print('===')"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "oU8Uc1FQimaf"
      },
      "source": [
        "## Part 3: Generative Feedback Loops\n",
        "\n",
        "[Generative Feedback Loops](https://weaviate.io/blog/generative-feedback-loops-with-llms) refers to the process of storing the output from the language model back to the database.\n",
        "\n",
        "You will generate a description for each product in our database using the Gemini API and save it to the `generated_description` property in the `Products` collection."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "rCUXn9q0rDxf"
      },
      "source": [
        "### Connect and configure the Gemini API model\n",
        "\n",
        "Make sure you have initialized your Gemini Client. Please confirm this step was done in [Part 1](#part-1-connect-to-weaviate-define-schema-and-import-data)."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "4h7iw16Viny1"
      },
      "source": [
        "### Generate a description and store it in the `Products` collection\n",
        "\n",
        "Steps for the below cell:\n",
        "1. Run a vector search query to find travel jackets\n",
        "    * Learn more about autocut (`auto_limit`) [here](https://weaviate.io/developers/weaviate/api/graphql/additional-operators#autocut).\n",
        "\n",
        "2. Grab the returned objects, prompt the Gemini API with the task and image, store the description in the `generated_description` property"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {
        "id": "Qjz4iYtbP5Ni"
      },
      "outputs": [
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo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yey9P6udGGxEcPTcKcEn3/AF9e3bsFFFFdxzHkfxqixcaHPxyJY+emflNeZWcoh1exlDKpjuYmypwRhxXrnxqg3eH9MuOP3V2VJPbcp/8Aia8N1C6KRllYZX5vlHpSGdN42XZ428RRsBkXrMPocH+tV43Xb92M4Hdq0/iTGD46vJkwPtdvb3GD7xjP8qw1lAhz5kYGOTtoAZO6NkqU6/wnqa04JUWNciH7o+82DWMZRJnBJABx8mKtmfywvzgjaPl2ZxSAW6dZHb5Uxjja1a/gKDzvH+gIAflmMhOc/dQmufkctuIaMgjpjBrs/hFALnx+jkJm2tJHGOuTtX/2Y0wIfHN6954u1WeVsGOcwKNv8KfKP8+9aXwhtjL4wln6iG1difckAfzNc34hm8/xBqrbmCtfTngZH3zXoPwYtf3Or3p5y0cKnHoCx/mKAPVKKKKYgooooA4j4s25n+H91IBzBNFL9Bu2n/0Kvm7VDmF8OGyOg7V9e6rptvrGlXWm3QJguYzG+04IB7j3HWuEj+CXhJdvnHUZiOu64wD9cAUAZ3iP4b3/AIlGlatp95bo/wDZsEMkU2VztXgggH1rmpvhZ4uB2rbwSAHgi4TH6171HGkUSRRqEjRQqqOgA4Ap1AHgI+FPi6Th4LdVPBzcp/SmTfDDxiu1Us4yF/uzx8/ma+gaKVgPn+D4U+MJpP3kMEK9PnuEwP8AvnJr0L4e+A7jwhcXuoahcQy3E0YjVYckIoO48kDknH5V31FMD5Xku1maa4aRhJNI8gUcjkk5/WvbvhJAI/A6zjn7RcyPn1Awv/spqzffCzwdfM7NpIhZySTBM6c/TOP0ro9G0i00HR7XS7BGW2tk2IGOSeckk9ySSaQF6iiimAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Okay, here's a short Facebook ad based on the image:\n",
            "\n",
            "**Option 1 (Focus on style and functionality):**\n",
            "\n",
            "Image: (Product Photo)\n",
            "\n",
            "Text:\n",
            "\n",
            "> Gear up for cooler weather with our custom-branded lightweight puffer jacket!  Stay warm and represent your brand in style.  Perfect for employees, clients, or events. Add a matching face mask for complete protection. Get your quote today!  #brandedapparel #companygear #promotionalproducts #customjacket #employeeappreciation\n",
            "\n",
            "**Option 2 (Emphasis on customization):**\n",
            "\n",
            "Image: (Product Photo)\n",
            "\n",
            "Text:\n",
            "\n",
            "> Looking for a way to promote your business?  Our custom apparel is a great way to put your brand on display!  Get your logo embroidered on our high-quality jackets and masks.  Stand out from the crowd! Click to learn more and get a free quote! #customlogo #brandmerchandise #marketingideas #businessgifts #corporatewear\n",
            "\n",
            "**Option 3 (Short & Sweet)**\n",
            "\n",
            "Image: (Product Photo)\n",
            "\n",
            "Text:\n",
            "\n",
            ">Stay warm and represent your brand!  Custom jackets and masks available now.  Shop today! #brandedgear #company swag #[YourCompany]\n",
            "\n",
            "===\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8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bSSRhIrSSbTsiXPLMewoEfSHxbTzPh5dtg/LNC3/j4H9a8V8Bxeb8S/DwGeLrdz7Ix/pXufxRhM3w61bbyY1jk/J1rw3wBL5fxH0CTric/+gNQBzkgxe3KsMlZWyAO+aYW8yQptPT5jTGdp7md8kGSQsce5qYKkaBQ2PoOSaBkYGZWUDjGCPShn6qUYEdgTSRv+9Zl/IelEw3ENv6d8UwNqw/ffDXxbDtAENxYzjPUfOyH/wBCrGswSsA9XUfqK2dCjWTwd42Yk7lsbcgev79D/hWZo8Rl1DTolXBe5iUH6sKQH2EBgAelFK33j9aKBFTUpZoNKvZbdC86QSNGo6lgpIH518VzSbyWYHceTz3r7erlb34a+DdQ1A31zoFq1wz72KlkV265KggH8uaAM34Q6H/Y/wAONP8AOiAmvC124Yc4f7v/AI6Fru1UKMKAB6AYoVVRQqqFVRgADAApaAMDxxF53gTXU/6cpD+Qz/SvnjwI2fH2gH5Tm6UY57gj+tfUrKroyOoZWGCrDII96pW2i6VZT+fa6ZZQSjpJFAqsPxAoA+UNW0PVdB1O4s7+1aCRHP3h8pGeCp7j6VBBZ3ty2y1tZJ5G/uJuJ+gFfYTxpKMSIrj0ZQaERIxiNFQf7IxQB8gtomsWxL3Ol3kat3aBlH6iqjJcbiph3H/d5r7MyfU0zy0Dbti59dooA+adA8PX1r8PPGWqXtnLbQy2cUMDyqV3/vVLYB69F5rD8IwibxbocAZTm+h4J/2wa+rru1t7+1ltbyFJ7eVdskcgyrD0IrBsfAPhXTb+K9tNFgjuImDRvlm2EdCASRmgDpD1NFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//9k=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Here are a few options for a short Facebook ad for the jacket pictured:\n",
            "\n",
            "**Option 1 (Focus on style and warmth):**\n",
            "\n",
            "Image: The provided photo\n",
            "Text: Stay warm AND stylish this season! Check out our new quilted jacket. Perfect for layering and showing off your brand logo. Shop now! [Link to product page]\n",
            "\n",
            "**Option 2 (Focus on customization):**\n",
            "\n",
            "Image: The provided photo\n",
            "Text: Looking for branded apparel?  Get your logo on this sleek, comfortable jacket. Great for your team or as promotional swag.  Inquire today! [Link to contact/inquiry page]\n",
            "\n",
            "**Option 3 (Short & Sweet):**\n",
            "\n",
            "Image: The provided photo\n",
            "Text: New Jacket Alert!  Customizable and perfect for cooler weather.  Shop now! [Link to product page]\n",
            "\n",
            "**Tips for improvement:**\n",
            "\n",
            "*   **Targeting:** Use Facebook's targeting options to reach people interested in outerwear, corporate apparel, or specific industries.\n",
            "*   **Call to Action:** Make sure your \"Shop Now\" or \"Inquire Today\" button is prominent.\n",
            "*   **A/B Testing:** Try different ad copy and images to see what performs best. You could try showing a person wearing the jacket.\n",
            "*   **Video:** A short video showing the jacket being worn could be even more effective.\n",
            "===\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHw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o8rD1Y5/rXuHwQuy3hu/sSu0QXO9B6Kyj+oNdZH4B8LRPuXR7fPockfqa2rLTrLTYvKsrWG3T+7GgUH8qQFqiiigAooooA87+Mz48HW8W4L5l4nJHorGvCJNu0KJwcEE4j6V9V6vomm69aLa6paR3MKtvVX7HGMj864rUfg5oFwCbCe6sW6hVfemfof8AGgDwdpF80H7bLwDzs6fpUiyrgj7bM3tsIz+ldnrfw28TaTIwhtPt0HaWAA8e69a5G5hv7eRluF8tgcFZISp/WmMYxMJKPeShvZSQf0qBpFLKft0xwe6dP0qZBcu2ItoP90x7jn8K6DS/B3ibV2XydNl2Pj99IgjUfnQBzgK+YxNxkMBlmj6/pXq/wSmCX2rW3mB98aSDAx0JH9a0NK+DNoI1k1e/mkkP3ooDsX6Z6mu30Hwfofhp2k0uzEMjrsZ9xJYdec0CN2iiikAUUUUAFFFFABRRRQAVHJbwzf62JH/3lBoooAatpbI25beJW9QgBqYADoKKKACiiigAooooAKKKKAP/2Q==",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Okay, here's a short Facebook ad for the black puffer coat with the Google logo:\n",
            "\n",
            "**Option 1 (Focus on warmth and style):**\n",
            "\n",
            "Image: [The image of the coat]\n",
            "\n",
            "Headline: Stay Warm, Stay Stylish.\n",
            "\n",
            "Body: Brave the cold in our sleek black puffer coat! Featuring a subtle Google logo, this coat is perfect for layering. Limited quantities available.\n",
            "\n",
            "Button: Shop Now\n",
            "\n",
            "**Option 2 (Focus on brand and functionality):**\n",
            "\n",
            "Image: [The image of the coat]\n",
            "\n",
            "Headline: Gear Up with Google!\n",
            "\n",
            "Body: Check out our new black puffer coat. Lightweight, warm, and sporting the iconic Google logo. Perfect for everyday wear!\n",
            "\n",
            "Button: Learn More\n",
            "\n",
            "**Option 3 (Short and Sweet):**\n",
            "\n",
            "Image: [The image of the coat]\n",
            "\n",
            "Headline: New Google Coat!\n",
            "\n",
            "Body: Stay warm and rep your favorite brand. Grab yours now!\n",
            "\n",
            "Button: Shop Now\n",
            "\n",
            "**Notes:**\n",
            "\n",
            "*   I kept the language concise and action-oriented, as Facebook ads need to grab attention quickly.\n",
            "*   The \"Shop Now\" or \"Learn More\" button is crucial for driving traffic to the product page.\n",
            "*   I assumed the target audience is familiar with the Google logo. If you need to be more explicit, you could add \"Official Google merchandise\" in the body.\n",
            "*   Consider A/B testing different versions of the ad copy to see what resonates best with your audience.\n",
            "*   If this is a limited-edition item, definitely emphasize that in the copy to create a sense of urgency.\n",
            "===\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2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YYnL/bJJr2Rv9plXj8AQPwoA87Ve9Nx84OKeCCR708KMj5gaAHXK/vFI/uj+VRLVi5A8wdPuioVFADoovOnjh/56OE468nFRIjRFkYFWRipB6gjirllgalZ47Txn/x4Ve8Y2C6Z4112zQ5SK+lCnrwWJA/WgDtvgffeT49EBJ/0m0kT8Rhv/Za+j6+YPgrMIPiVZh8fvYZYx9dhP9K+n6ACiiigArzn42qx+H/HQXkefyavRq4/4o2X274c6ugGWiRZh/wFgT+maAPlUIQ3XvXqXxCgjX4P+BjGOArfmUyf1rzBW2nbXqXiki9+BHhaXcCYLtoj/wCRB/QUAeTbcYzUi4z709kxtpp+91oAmuQrEHj7oqspAJ5qWbO0HP8ACKrZPNAFm1Z3vIBHy/mLtHvkYrofiChT4ieIN/3jeuTn3xWJohRNf01pMbBdRFvpvGa6v4uYPxQ1rp9+Pp/1zWgCv8MCV+JOh7Ccm4wcem05r6ur5j+Ctkbr4kWshGRbwyzH/vnaP1avpygAooooAKoa3p39r6DqGnBgpurd4gx6AlSAfzq/RQB8oH4aeNVvDbHw7ds4ON6hdh992cYr1a0+FuqXfwtg8PX15Fa38d414gHzouRjYSPqTkZ59a9ZooA+XNV+Fni/TJmQ6TJdxr0ktSJAfy5/MVzd3oGsWjlbnSb6Ejr5lu4/mK+x6XJ9TQB8aTaNqipDnT7r96m5MQt8wyRkce1WrPwP4ovGH2fw/qLn1+zso/MivsHJ9TSZJ70AfOOgfBDxNd3VvPqLW+mwK6u25w8mAc4CrkZ+prJ+LWk6jZfEDVrqe1mFtcyCWKbYSjKVH8WMZGOlfUlBAZSrAFT1B5FAHgn7PdmJNW1m/IJ8qBIlOOPmYk8/8BFe90yOKKFSsUaRqTkhFAGfwp9ABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAf/9k=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Okay, here are a couple of options for a Facebook ad for that fleece jacket:\n",
            "\n",
            "**Option 1 (Focus on Exclusivity):**\n",
            "\n",
            "Headline:  Limited Edition Google Fleece - Get Yours Now!\n",
            "\n",
            "Body:  Stay warm and stylish with this exclusive Google employee fleece jacket. Super soft, high quality, and only available while supplies last.  Grab yours before they're gone! #Google #Fleece #EmployeeGear #LimitedEdition #TechStyle\n",
            "\n",
            "**Option 2 (Focus on Comfort & Function):**\n",
            "\n",
            "Headline: Stay Cozy with the Google Fleece Jacket!\n",
            "\n",
            "Body:  Perfect for chilly days, this super-soft fleece is designed with comfort and functionality in mind. Sport that tech look with this official fleece, featuring the Google logo.  Shop now and upgrade your wardrobe! #Google #FleeceJacket #TechGear #WinterFashion #ComfortStyle\n",
            "\n",
            "**Why these work:**\n",
            "\n",
            "*   **Clear Value Proposition:** Each ad highlights the key benefits (exclusivity/comfort)\n",
            "*   **Strong Call to Action:** Encourages immediate action (\"Get Yours Now!\", \"Shop Now!\")\n",
            "*   **Relevant Hashtags:** Increases visibility and helps people find the ad.\n",
            "*   **Visual Connection:** The image itself shows the product clearly.\n",
            "\n",
            "You can test both versions to see which performs better with your target audience. Good luck!\n",
            "\n",
            "===\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6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R6bfSMNkF3DIeMjAcE16v8erGGLVdG1FGzNPDJAy+oQhgf/HyK8VnbAbClGxng1678ZdTS/0Xwa5UebPZtcl/4gGWPj6Zz+VAHmmheaPE2lbSpb7bCQAc5O8V9kt94/WvjzwlDFN410OLe+Wv4Bkf74r7CPU0AFFFFABRRRQAV8w/GOSRfibqJ3qAI4QAfTy1r6eqOS3gm/1sEUn++gP86APieRzM2WZSPrxVlbgqoVZYlA9K+wJfDehTyeZLommu/wDea0Qn+VIfDWgt10PTD/26R/4UAfH4mdW/1oUsAee9DyAj59jD1U819hTeHdEuAom0bTpAoCjdaocAdB06VW/4Q3wwWDf8I7pWR3+yJ/hQB8ekoz7UYsf7vWux8bzySWPhAPvJTQoV2MpGCHcd/p+lfUVtpen2YAtbC0gx08qBV/kK57xn8P8ASPG6W7XzTW9zBkJcQY3bT1U5BBHf2oA+d/hxaPffEjQoVi4W6ErYXoEBY/yr6zrkvCHw60HwY7z2Ecs964Km6uGDOFOPlGAABx2Ga62gAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9k=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Okay, here are a few options for a Facebook ad based on the image, with varying levels of specificity and targeting.\n",
            "\n",
            "**Option 1 (Focus on Quality & Prestige):**\n",
            "\n",
            "```\n",
            "Image: [Image of the jacket]\n",
            "\n",
            "Headline: Stay Warm in Style: Marmot for Google\n",
            "\n",
            "Body:  Experience the ultimate in warmth and performance with this Marmot down jacket.  Featuring the Google logo, this jacket is a perfect blend of comfort and modern style.  Limited quantities available!\n",
            "\n",
            "Call to Action: Learn More\n",
            "```\n",
            "\n",
            "**Option 2 (Focus on Exclusivity and targeted to Google employees):**\n",
            "\n",
            "```\n",
            "Image: [Image of the jacket]\n",
            "\n",
            "Headline: Google Employee Exclusive: Marmot Down Jacket\n",
            "\n",
            "Body: Stay warm and rep Google with this Marmot down jacket. Featuring the iconic Google logo, this jacket is only available to Google Employees.\n",
            "\n",
            "Call to Action: Check Availability\n",
            "```\n",
            "\n",
            "**Option 3 (Short & Sweet - Broad Appeal):**\n",
            "\n",
            "```\n",
            "Image: [Image of the jacket]\n",
            "\n",
            "Headline:  Stylish and Warm Jacket - Limited Stock!\n",
            "\n",
            "Body:  Stay cozy this season with this stylish quilted jacket. Don't miss out!\n",
            "\n",
            "Call to Action: Shop Now\n",
            "```\n",
            "\n",
            "**Key Considerations & Why I chose these:**\n",
            "\n",
            "*   **Visual Appeal:** The image is clean and shows the jacket well.\n",
            "*   **Clear Value Proposition:**  Focuses on warmth, style, and (in some cases) exclusivity.\n",
            "*   **Strong Call to Action:**  Encourages immediate engagement.\n",
            "*   **Targeting:** Option 2 targets Google Employees, and therefore is more specific.\n",
            "===\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA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47mxduf3ExI/Js0AeVfCfwy+u+Mo7qZCbSxxM+RwX/hH58/hR8YbQ2fxGvHVMLPHHMPfKgE/mDXungvwdbeDNLlsredpzJKZGldQGPYA/QCuR+KHw71fxdrdle6U1qoS38qUzuRyGJGAAc9TTA8BSdWB34HuKk3hvmAOfp1r0Vfgb4nXn7Rp+faVv8A4mnj4JeJx/y20/8A7+t/8TQB51vAC/Kckc5+tRTNv4G4D24r0xvgx4ndUXdYLtXBPnMdxyT/AHfTFRN8FfFY+61gf+2x/wDiaAPNVZVUqec+vWvXfhl4Wj174f8AiOFlBku2CRN6Oi7lx/wI1iyfBbxeq522L+yz8n8wK9l+Hfh648M+ELawu0VLoMzyhTkAk+v0xQB8sFJRIytGFkUkMT1Br6G+EWsy61ph82MI2n2sNkW3Z8zbuIb24bH4VT1f4J22qeI73Uk1Z7e3upTL5CQAlCeSASfXPaux8HeCrLwZaXEFncTz+ewd3mIJyBjjAFAHTUUUUgCiiigAooooAKKKKACiiigAooooAKKKKACiiigD/9k=",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Here are a few options for a Facebook ad:\n",
            "\n",
            "**Option 1 (Focus on style):**\n",
            "\n",
            "Headline: Level Up Your Look: Android Jacket\n",
            "\n",
            "Body: Show your Android pride with this sleek track jacket. Featuring a classic design with a modern twist. Grab yours now and stand out from the crowd!\n",
            "\n",
            "Call to Action: Shop Now\n",
            "\n",
            "**Option 2 (Focus on community):**\n",
            "\n",
            "Headline: Rep Your Favorite OS!\n",
            "\n",
            "Body: Are you team Android? Show your allegiance with this limited edition track jacket.  Comfortable, stylish, and the perfect way to connect with fellow Android enthusiasts.\n",
            "\n",
            "Call to Action: Learn More\n",
            "\n",
            "**Option 3 (Short and sweet):**\n",
            "\n",
            "Headline: Android Style is Here!\n",
            "\n",
            "Body: Rock the Android look with this awesome jacket. Get yours today!\n",
            "\n",
            "Call to Action:  Shop Now\n",
            "\n",
            "===\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3OiiigAooooAKz9W13StCgWbVdRt7ONzhTM4XcfYdTTPEOu2nhvQ7nVbw/uoV4UHl2P3VHuTXyh4n16/8SarPqeozb5mPyqD8sa54VR2AoA+oLPx54T1C7jtLXxBYyzyHCIJMbj6c8V0VfEsA/fCvf/hB47m1Ef8ACOarOZLiJN1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e8eXX2LwDrs+cEWcij6sNv9a+TY5M4AIA96+w9c0a18Q6Lc6Ve+Z9muFCv5bbW4IPB+oFeWX/wAsHJbTtcuIT2WeFXH5jFAHi2B1yCfU00tgDByTXpN38CPEsTH7LqdhOvuzIf1X+tZ7/BXxqh4W1f3E6/1pjOJhZRGQSM7j3pSRnIYceldqPgt41lYb1t1GAOblf6Cr9r8CfE0mPtGo2MI7/OX/ktAXPNpGGN24ADtXqvwDvgNf1e0Jx5lsrqPXa2P/Zq07P4Aw/KdR1+V8dVggC/qSf5V3Hhf4baB4SvFvdOW5a6CFDLLLnIPUYGB2pAdfRRRQIKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Okay, here's a short Facebook ad for the hoodie vest in the picture:\n",
            "\n",
            "**Headline:** Stay Warm & Stylish: Limited Edition Google Vest!\n",
            "\n",
            "**Body:** Gear up for cooler weather with this sleek, comfortable hooded vest. Features a modern design, a cozy hood, and the iconic Google logo. Perfect for layering or wearing on its own. Get yours before they're gone!\n",
            "\n",
            "**Call to Action:** Shop Now! [Link to product page]\n",
            "\n",
            "**Targeting suggestions:**\n",
            "*   Interests: Google, Technology, Outerwear, Activewear\n",
            "*   Demographics: People who work at Google or have an interest in Google\n",
            "\n",
            "===\n"
          ]
        }
      ],
      "source": [
        "response = products.query.near_text( # first find travel jackets\n",
        "    query=\"travel jacket\",\n",
        "    return_properties=[\"title\", \"description\", \"category\", \"link\"],\n",
        "    auto_limit=1, # limit it to 1 close group\n",
        ")\n",
        "\n",
        "for product in response.objects:\n",
        "    if \"link\" in product.properties:\n",
        "        id = product.uuid\n",
        "        img_url = product.properties[\"link\"]\n",
        "\n",
        "        pil_image = url_to_pil(img_url) # convert image to PIL object\n",
        "        generated_description = gemini_client.models.generate_content(\n",
        "            model=\"gemini-2.5-flash\",\n",
        "            contents=[\n",
        "                \"Write a short Facebook ad about this product photo.\",\n",
        "                pil_image\n",
        "            ]\n",
        "        ) # prompt to the Gemini API\n",
        "        generated_description = generated_description.text\n",
        "        display_image(product.properties['link'])\n",
        "        print(generated_description)\n",
        "        print('===')\n",
        "\n",
        "        # Update the Product collection with the generated description\n",
        "        products.data.update(\n",
        "            uuid=id,\n",
        "            properties={\"generated_description\": generated_description}\n",
        "        )"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7LjeX-2_vVb5"
      },
      "source": [
        "### Vector Search on the `generated_description` property\n",
        "\n",
        "Since the product description was saved in our `Products` collection, you can run a vector search query on it."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 20,
      "metadata": {
        "id": "suWRGv6Zu6g2"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "56ab6aa2-a2d7-4f9e-a08a-40444a80cae4\n",
            "{\n",
            "  \"description\": \"This GON jacket is a stylish and functional piece of outerwear It is made of highquality materials and features a waterresistant finish The jacket also has a number of pockets for storing your belongings The jacket is perfect for a variety of occasions whether youre going to work or just running errands\",\n",
            "  \"title\": \"GON Jacket\",\n",
            "  \"generated_description\": \"Okay, here's a short Facebook ad based on the image:\\n\\n**Option 1 (Focus on style and functionality):**\\n\\nImage: (Product Photo)\\n\\nText:\\n\\n> Gear up for cooler weather with our custom-branded lightweight puffer jacket!  Stay warm and represent your brand in style.  Perfect for employees, clients, or events. Add a matching face mask for complete protection. Get your quote today!  #brandedapparel #companygear #promotionalproducts #customjacket #employeeappreciation\\n\\n**Option 2 (Emphasis on customization):**\\n\\nImage: (Product Photo)\\n\\nText:\\n\\n> Looking for a way to promote your business?  Our custom apparel is a great way to put your brand on display!  Get your logo embroidered on our high-quality jackets and masks.  Stand out from the crowd! Click to learn more and get a free quote! #customlogo #brandmerchandise #marketingideas #businessgifts #corporatewear\\n\\n**Option 3 (Short & Sweet)**\\n\\nImage: (Product Photo)\\n\\nText:\\n\\n>Stay warm and represent your brand!  Custom jackets and masks available now.  Shop today! #brandedgear #company swag #[YourCompany]\\n\"\n",
            "}\n"
          ]
        }
      ],
      "source": [
        "products = client.collections.get(\"Products\")\n",
        "\n",
        "response = products.query.near_text(\n",
        "        query=\"travel jacket\",\n",
        "        return_properties=[\"generated_description\", \"description\", \"title\"],\n",
        "        limit=1\n",
        "    )\n",
        "\n",
        "for o in response.objects:\n",
        "    print(o.uuid)\n",
        "    print(json.dumps(o.properties, indent=2))"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Qs5hE2k0OuOh"
      },
      "source": [
        "## Part 4: Personalization\n",
        "\n",
        "So far, you've generated product descriptions using the Gemini API with the `gemini-2.0-flash` model. In Part 4, you will generate product descriptions tailored to the persona.\n",
        "\n",
        "You will use [cross-references](https://weaviate.io/developers/weaviate/manage-data/cross-references) to establish directional relationships between the Products and Personas collections."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 21,
      "metadata": {
        "id": "b0473a28"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "None\n"
          ]
        }
      ],
      "source": [
        "result = client.collections.delete(\"Personalized\")\n",
        "print(result)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 22,
      "metadata": {
        "id": "ba56WznY53C1"
      },
      "outputs": [],
      "source": [
        "PROJECT_ID = \"\" # leave this empty\n",
        "API_ENDPOINT = \"generativelanguage.googleapis.com\"\n",
        "embedding_model = \"text-embedding-004\" # embedding model\n",
        "generative_model = \"gemini-1.5-flash-latest\"\n",
        "\n",
        "# Personalized Collection\n",
        "\n",
        "if not client.collections.exists(\"Personalized\"):\n",
        "  collection = client.collections.create(\n",
        "    name=\"Personalized\",\n",
        "    vectorizer_config=Configure.Vectorizer.text2vec_palm(\n",
        "        project_id=PROJECT_ID,\n",
        "        api_endpoint=API_ENDPOINT,\n",
        "        model_id = embedding_model\n",
        "    ),\n",
        "    generative_config=Configure.Generative.palm(\n",
        "        project_id=PROJECT_ID,\n",
        "        api_endpoint=API_ENDPOINT,\n",
        "        model_id = generative_model\n",
        "    ),\n",
        "    properties=[\n",
        "            Property(name=\"description\", data_type=DataType.TEXT),\n",
        "    ],\n",
        "    # cross-references\n",
        "    references=[\n",
        "        ReferenceProperty(\n",
        "            name=\"ofProduct\",\n",
        "            target_collection=\"Products\" # connect personalized to the products collection\n",
        "        ),\n",
        "        ReferenceProperty(\n",
        "            name=\"ofPersona\",\n",
        "            target_collection=\"Personas\" # connect personalized to the personas collection\n",
        "        )\n",
        "    ]\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "a44952d7"
      },
      "source": [
        "### Create two personas (Alice and Bob)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 23,
      "metadata": {
        "id": "j1RlEbYpOw_5"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "e2c96468-aed0-4ca7-92a3-274e77ee6972\n",
            "## Alice, the Sustainable Style Seeker\n",
            "\n",
            "**Description:**\n",
            "\n",
            "Alice is a 28-year-old graphic designer living in a bustling city. She's driven, creative, and deeply passionate about ethical and sustainable living. Having seen firsthand the impact of fast fashion on the environment and garment workers, she's committed to building a wardrobe that's both stylish and kind. She's not necessarily looking for cheap, but she *is* looking for value – pieces that are high-quality, versatile, and made with sustainable materials and fair labor practices. Alice is active on social media, particularly Instagram and Pinterest, where she seeks inspiration for her personal style and connects with like-minded individuals. She values transparency and authenticity in brands, and is willing to invest in products that align with her values, even if they come with a slightly higher price tag.\n",
            "\n",
            "===\n",
            "587cc5a5-8876-48d9-8b1d-1cb70c697c2c\n",
            "## Meet Bob: The Data-Driven Dad\n",
            "\n",
            "**Description:**\n",
            "\n",
            "Bob is a 45-year-old Marketing Manager at a mid-sized manufacturing company. He's a practical, analytical guy who trusts data and measurable results. Outside of work, he's a dedicated husband and father of two teenagers. He enjoys grilling, coaching his son's little league team, and staying on top of the latest tech trends to impress his kids (and stay ahead of the curve at work). He's increasingly frustrated with the inefficiency of his current marketing software and is actively looking for a solution that will streamline processes, provide actionable insights, and ultimately, demonstrate a clear ROI to his boss and the executive team. Bob values efficiency, transparency, and anything that will free up more time for him to spend with his family. He's wary of \"shiny object syndrome\" and prefers proven solutions with strong user reviews and case studies.\n",
            "\n",
            "===\n"
          ]
        }
      ],
      "source": [
        "personas = client.collections.get(\"Personas\")\n",
        "\n",
        "for persona in ['Alice', 'Bob']:\n",
        "  generated_description = gemini_client.models.generate_content(\n",
        "      model=\"gemini-2.5-flash\",\n",
        "      contents=[\n",
        "          \"Create a fictional buyer persona named \"\n",
        "          + persona + \", write a short description about them\"\n",
        "      ]\n",
        "  ) # use gemini-2.0-flash to generate persona description\n",
        "  uuid = personas.data.insert({\n",
        "    \"name\": persona,\n",
        "    \"description\": generated_description.text\n",
        "  })\n",
        "  print(uuid)\n",
        "  print(generated_description.text)\n",
        "  print(\"===\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 24,
      "metadata": {
        "id": "B0oKIH5vQhhw"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "587cc5a5-8876-48d9-8b1d-1cb70c697c2c {'description': '## Meet Bob: The Data-Driven Dad\\n\\n**Description:**\\n\\nBob is a 45-year-old Marketing Manager at a mid-sized manufacturing company. He\\'s a practical, analytical guy who trusts data and measurable results. Outside of work, he\\'s a dedicated husband and father of two teenagers. He enjoys grilling, coaching his son\\'s little league team, and staying on top of the latest tech trends to impress his kids (and stay ahead of the curve at work). He\\'s increasingly frustrated with the inefficiency of his current marketing software and is actively looking for a solution that will streamline processes, provide actionable insights, and ultimately, demonstrate a clear ROI to his boss and the executive team. Bob values efficiency, transparency, and anything that will free up more time for him to spend with his family. He\\'s wary of \"shiny object syndrome\" and prefers proven solutions with strong user reviews and case studies.\\n', 'name': 'Bob'}\n",
            "e2c96468-aed0-4ca7-92a3-274e77ee6972 {'description': \"## Alice, the Sustainable Style Seeker\\n\\n**Description:**\\n\\nAlice is a 28-year-old graphic designer living in a bustling city. She's driven, creative, and deeply passionate about ethical and sustainable living. Having seen firsthand the impact of fast fashion on the environment and garment workers, she's committed to building a wardrobe that's both stylish and kind. She's not necessarily looking for cheap, but she *is* looking for value – pieces that are high-quality, versatile, and made with sustainable materials and fair labor practices. Alice is active on social media, particularly Instagram and Pinterest, where she seeks inspiration for her personal style and connects with like-minded individuals. She values transparency and authenticity in brands, and is willing to invest in products that align with her values, even if they come with a slightly higher price tag.\\n\", 'name': 'Alice'}\n"
          ]
        }
      ],
      "source": [
        "# print objects in the Personas collection\n",
        "\n",
        "personas = client.collections.get(\"Personas\")\n",
        "\n",
        "for persona in personas.iterator():\n",
        "    print(persona.uuid, persona.properties)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "4442bbc4"
      },
      "source": [
        "### Generate a product description tailored to the persona\n",
        "\n",
        "Grab the product uuid from Part 1 and paste it below"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 25,
      "metadata": {
        "id": "UHi0V1MX2uNO"
      },
      "outputs": [
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG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bqlloPj21nu5BDDPG9uzseFLYxn0GQPzr6bpCCiiigAooooAKKKKAKWsC8Oi339nyeXeiBzA+0HDgHHB4618l6treqa9efatVvprq4A2gyn7o9AOgH0r7CHUV8geILQWXibVLZOFiu5UGPQOcUAZ6nPP6Ujj95G2OjYFKpABzxzwacR5mMY4OaYxqZweh5NLtbj5jj2pEUjPGfmPFPzjrnp0NADAq7jjt6969n+Cusa7qGo3dnc6jNPplrbgrFKd+1icKATyOAeM4rxcEtnA79693+BFqqeHtUuyBvluhHn2VQf/AGagD1iiiikIKKKKACiiigBR1FfH+u3gu/EeqXQI2y3cr/gXNfW+oXAtNNu7k8CGB5PyUn+lfG3zSBmfktyaAJFUMoLjn2qTG3GOaZkgEL2oznA6etMY5Adh7HceSaQcnkdvwoTO04zgsfrSgknP6GgBmdrkHvXvPwKl3eGtUi/uXgP5oP8ACvBWxuU8dxmva/gHKPsmuQZ6SRNj8GH9KAPY6KKKQgooooAKKKKAOe8eXX2LwDrs+cEWcij6sNv9a+TY5M4AIA96+w9c0a18Q6Lc6Ve+Z9muFCv5bbW4IPB+oFeWX/wAsHJbTtcuIT2WeFXH5jFAHi2B1yCfU00tgDByTXpN38CPEsTH7LqdhOvuzIf1X+tZ7/BXxqh4W1f3E6/1pjOJhZRGQSM7j3pSRnIYceldqPgt41lYb1t1GAOblf6Cr9r8CfE0mPtGo2MI7/OX/ktAXPNpGGN24ADtXqvwDvgNf1e0Jx5lsrqPXa2P/Zq07P4Aw/KdR1+V8dVggC/qSf5V3Hhf4baB4SvFvdOW5a6CFDLLLnIPUYGB2pAdfRRRQIKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Okay, here's a product description for the Google Women's Tech Fleece Vest, tailored for Bob:\n",
            "\n",
            "**Google Women's Tech Fleece Vest: Smart Layering for the Active (and Efficient!) Dad**\n",
            "\n",
            "Bob, we know you're a busy guy – Marketing Manager, coach, dad – you're always on the go. That's why you need gear that can keep up. This Google Women's Tech Fleece Vest isn't just stylish; it's a smart, practical addition to your wife's wardrobe.\n",
            "\n",
            "Here's why this vest is a win for *her* and, indirectly, a win for *you*:\n",
            "\n",
            "*   **Layering Made Easy (and Efficient):** This vest is perfect for those cool mornings at the baseball field or evenings grilling out back. It's lightweight enough to layer without bulk, meaning less fuss and more time enjoying the game (or the perfectly cooked burger!).\n",
            "\n",
            "*   **Data-Backed Comfort:** The soft fleece lining provides warmth without overheating, and the water-resistant finish means she's protected from light rain. No more last-minute dashes inside because of a drizzle!\n",
            "\n",
            "*   **Practical Design:** Two zippered hand pockets mean she can keep her phone, keys, or other essentials secure and accessible. An adjustable hem ensures a comfortable, custom fit. No more complaints about her clothes being unfunctional.\n",
            "\n",
            "*   **Happy Wife, Happy Life (and More Free Time for You):** When she's comfortable and prepared, she's less stressed, leaving you more time to focus on what matters – whether that's closing that big deal at work or perfecting your pitching strategy.\n",
            "\n",
            "Think of it as an investment in your family's comfort and efficiency, Bob. It's a practical, well-designed piece that will quickly become a go-to in her wardrobe. Plus, you get to leverage Google's reputation for smart, reliable tech… even in clothing!\n",
            "\n",
            "====\n",
            "## Alice, Meet Your New Favorite Layer: The Google Women's Tech Fleece Vest\n",
            "\n",
            "Alice, are you looking for a versatile layering piece that aligns with your values and elevates your sustainable style? The Google Women's Tech Fleece Vest might be exactly what you've been searching for.\n",
            "\n",
            "Imagine this: it's a crisp autumn morning, you're cycling to your studio, and you need an extra layer to keep you warm without feeling bulky. This lightweight vest is perfect. Not only is it incredibly comfortable thanks to its soft fleece lining, but its water-resistant finish gives you peace of mind if you get caught in a light drizzle.\n",
            "\n",
            "But it's more than just comfortable and practical. We know how important sustainability is to you, Alice, and while we're always striving to do better, this vest is a step in the right direction. The durable construction means you'll have this piece in your wardrobe for years to come, reducing the need for fast-fashion alternatives. Plus, the classic design ensures it will complement your existing wardrobe, creating endless stylish and conscious outfit combinations.\n",
            "\n",
            "The two zippered hand pockets are perfect for keeping your essentials secure while you're on the go, whether you're grabbing coffee or exploring a new city park. And the adjustable hem allows you to customize the fit for maximum comfort and style.\n",
            "\n",
            "This isn't just a vest, Alice. It's an investment in a versatile, long-lasting piece that aligns with your values and complements your unique sense of style. Add the Google Women's Tech Fleece Vest to your wardrobe and experience the perfect blend of comfort, performance, and conscious living.\n",
            "\n",
            "====\n"
          ]
        }
      ],
      "source": [
        "personalized = client.collections.get(\"Personalized\")\n",
        "\n",
        "product = products.query.fetch_object_by_id(product.uuid)\n",
        "display_image(product.properties['link'])\n",
        "\n",
        "personas = client.collections.get(\"Personas\")\n",
        "\n",
        "for persona in personas.iterator():\n",
        "    generated_description = gemini_client.models.generate_content(\n",
        "        model=\"gemini-2.5-flash\",\n",
        "        contents=[\n",
        "            \"\"\"\n",
        "              Create a product description tailored to the following person,\n",
        "              make sure to use the name (\n",
        "            \"\"\",\n",
        "            persona.properties[\"name\"],\") of the persona.\\n\\n\",\n",
        "            \"# Product Description\\n\",\n",
        "            product.properties[\"description\"], \"# Persona\",\n",
        "            persona.properties[\"description\"]]\n",
        "    ) # generate a description tailored to the persona\n",
        "    print(generated_description.text)\n",
        "    print('====')\n",
        "    # Add the personalized description to the `description` property in the Personalized collection\n",
        "    new_uuid = personalized.data.insert(\n",
        "        properties={\n",
        "            \"description\": generated_description.text },\n",
        "        references={\n",
        "            \"ofProduct\": product.uuid, # add cross-reference to the Product collection\n",
        "            \"ofPersona\": persona.uuid # add cross-reference to the Persona collection\n",
        "        },\n",
        "    )\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "f3f56984"
      },
      "source": [
        "### Fetch the objects in the `Personalized` collection"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 26,
      "metadata": {
        "id": "gxZ1W_cK4_dw"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "{'description': \"Okay, here's a product description for the Google Women's Tech Fleece Vest, tailored for Bob:\\n\\n**Google Women's Tech Fleece Vest: Smart Layering for the Active (and Efficient!) Dad**\\n\\nBob, we know you're a busy guy – Marketing Manager, coach, dad – you're always on the go. That's why you need gear that can keep up. This Google Women's Tech Fleece Vest isn't just stylish; it's a smart, practical addition to your wife's wardrobe.\\n\\nHere's why this vest is a win for *her* and, indirectly, a win for *you*:\\n\\n*   **Layering Made Easy (and Efficient):** This vest is perfect for those cool mornings at the baseball field or evenings grilling out back. It's lightweight enough to layer without bulk, meaning less fuss and more time enjoying the game (or the perfectly cooked burger!).\\n\\n*   **Data-Backed Comfort:** The soft fleece lining provides warmth without overheating, and the water-resistant finish means she's protected from light rain. No more last-minute dashes inside because of a drizzle!\\n\\n*   **Practical Design:** Two zippered hand pockets mean she can keep her phone, keys, or other essentials secure and accessible. An adjustable hem ensures a comfortable, custom fit. No more complaints about her clothes being unfunctional.\\n\\n*   **Happy Wife, Happy Life (and More Free Time for You):** When she's comfortable and prepared, she's less stressed, leaving you more time to focus on what matters – whether that's closing that big deal at work or perfecting your pitching strategy.\\n\\nThink of it as an investment in your family's comfort and efficiency, Bob. It's a practical, well-designed piece that will quickly become a go-to in her wardrobe. Plus, you get to leverage Google's reputation for smart, reliable tech… even in clothing!\\n\"}\n",
            "{'title': 'Google Womens Tech Fleece Vest', 'link': 'https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGXXX1372.jpg'}\n",
            "{'name': 'Bob'}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QA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5a6CFDLLLnIPUYGB2pAdfRRRQIKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n",
            "{'description': \"## Alice, Meet Your New Favorite Layer: The Google Women's Tech Fleece Vest\\n\\nAlice, are you looking for a versatile layering piece that aligns with your values and elevates your sustainable style? The Google Women's Tech Fleece Vest might be exactly what you've been searching for.\\n\\nImagine this: it's a crisp autumn morning, you're cycling to your studio, and you need an extra layer to keep you warm without feeling bulky. This lightweight vest is perfect. Not only is it incredibly comfortable thanks to its soft fleece lining, but its water-resistant finish gives you peace of mind if you get caught in a light drizzle.\\n\\nBut it's more than just comfortable and practical. We know how important sustainability is to you, Alice, and while we're always striving to do better, this vest is a step in the right direction. The durable construction means you'll have this piece in your wardrobe for years to come, reducing the need for fast-fashion alternatives. Plus, the classic design ensures it will complement your existing wardrobe, creating endless stylish and conscious outfit combinations.\\n\\nThe two zippered hand pockets are perfect for keeping your essentials secure while you're on the go, whether you're grabbing coffee or exploring a new city park. And the adjustable hem allows you to customize the fit for maximum comfort and style.\\n\\nThis isn't just a vest, Alice. It's an investment in a versatile, long-lasting piece that aligns with your values and complements your unique sense of style. Add the Google Women's Tech Fleece Vest to your wardrobe and experience the perfect blend of comfort, performance, and conscious living.\\n\"}\n",
            "{'title': 'Google Womens Tech Fleece Vest', 'link': 'https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/GGOEGXXX1372.jpg'}\n",
            "{'name': 'Alice'}\n"
          ]
        },
        {
          "data": {
            "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjI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ktAXPNpGGN24ADtXqvwDvgNf1e0Jx5lsrqPXa2P/Zq07P4Aw/KdR1+V8dVggC/qSf5V3Hhf4baB4SvFvdOW5a6CFDLLLnIPUYGB2pAdfRRRQIKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z",
            "text/plain": [
              "<PIL.Image.Image image mode=RGB size=100x100>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "===\n"
          ]
        }
      ],
      "source": [
        "personalized = client.collections.get(\"Personalized\")\n",
        "\n",
        "response = personalized.query.fetch_objects(\n",
        "    limit=2,\n",
        "    return_references=[QueryReference(\n",
        "            link_on=\"ofProduct\", # return the title property from the Product collection\n",
        "            return_properties=[\"title\", \"link\"]\n",
        "        ),\n",
        "        QueryReference(\n",
        "            link_on=\"ofPersona\",\n",
        "            return_properties=[\"name\"] # return the name property from the Persona collection\n",
        "        )\n",
        "    ]\n",
        ")\n",
        "\n",
        "for item in response.objects:\n",
        "    print(item.properties)\n",
        "    for ref_obj in item.references[\"ofProduct\"].objects:\n",
        "        print(ref_obj.properties)\n",
        "    for ref_obj in item.references[\"ofPersona\"].objects:\n",
        "        print(ref_obj.properties)\n",
        "    display_image(product.properties['link'])\n",
        "    print(\"===\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "f61bca1b"
      },
      "source": [
        "## Notebook Recap"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7f5d9952"
      },
      "source": [
        "In this notebook, you learned how to:\n",
        "1. Create a Weaviate cluster using Embedded\n",
        "2. Define a Weaviate schema and select the embedding and generative model\n",
        "3. Connect to the Gemini API\n",
        "4. Perform vector and hybrid search with filtering and autocut\n",
        "6. Use Generative Feedback Loops to store the output of the language model back to the database for future retrieval\n",
        "7. Use cross-references to build relationships between collections"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "901aeb49"
      },
      "source": [
        "You can learn more about Weaviate through our [documentation](https://weaviate.io/developers/weaviate), and you can find more Weaviate and Google cookbooks [here](https://github.com/weaviate/recipes/tree/main/integrations/cloud-hyperscalers/google)!"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "cfba1c28"
      },
      "source": [
        "**Authors: Erika Cardenas and Bob Van Luijt**\n",
        "\n",
        "Connect with us and let us know if you have any questions!\n",
        "\n",
        "Erika's accounts:\n",
        "* [Follow on X](https://x.com/ecardenas300)\n",
        "* [Connect on LinkedIn](https://www.linkedin.com/in/erikacardenas300/)\n",
        "\n",
        "Bob's accounts:\n",
        "* [Follow on X](https://x.com/bobvanluijt)\n",
        "* [Connect on LinkedIn](https://www.linkedin.com/in/bobvanluijt/)"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "collapsed_sections": [
        "7Wlb0vCDUK3h",
        "t1Uc93joUOAR"
      ],
      "name": "personalized_description_with_weaviate_and_gemini_api.ipynb",
      "toc_visible": true
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
